package com.atmilan.quartz.constant.enums;

/**
 * x
 *
 * @author muyu.myw
 * @date 2020/9/28 12:18
 */
public enum OrangeChannelTypeEnum {
    CN(1,  "大陆","1-3","3-7"),
    HK(2,  "港澳","1-3","7-15"),
    EUR(3, "欧洲","1-3","20-25"),

    BA(4,"保税区","1-3","5-7"),
    FR(5,"法国","1-3","20-25"),
    KR(6,"韩国","1-3","15-20"),
    AUS(7,"澳洲","1-3","20-25"),
    GER(8,"德国","1-3","20-25"),
    JPN(9,"日本","1-3","15-20"),
    US(10,"美国","1-3","25-30"),

    OTHER(10,"其他待定","1-3","25-30");
    Integer tempId;
    String stockAreaName;
    //发货时间
    String deliverDays;
    //收货时间
    String arrivalDays;

    public Integer getTempId() {
        return tempId;
    }

    public String getStockAreaName() {
        return stockAreaName;
    }

    public String getDeliverDays() {
        return deliverDays;
    }

    public String getArrivalDays() {
        return arrivalDays;
    }

    public static OrangeChannelTypeEnum valueOf(Integer code) {
        for (OrangeChannelTypeEnum value : values()) {
            if (value.getTempId().equals(code)) {
                return value;
            }
        }
        return OrangeChannelTypeEnum.OTHER;
    }

    OrangeChannelTypeEnum(Integer tempId, String stockAreaName, String deliverDays, String arrivalDays){
        this.tempId = tempId;
        this.stockAreaName = stockAreaName;
        this.deliverDays = deliverDays;
        this.arrivalDays = arrivalDays;
    }
    
    public static OrangeChannelTypeEnum getByTempId(Integer tempId){
        if(tempId != null){
            for(OrangeChannelTypeEnum val : OrangeChannelTypeEnum.values()){
                if(val.tempId.equals(tempId)){
                    return val;
                }
            }
        }
        return HK;
    }
}
